// Coded by Shambler (Shambler@OldUnreal.com, Shambler__@Hotmail.com, ICQ: 108730864) and portal effects by Fuegerstef
Class pgPortalGunFire extends BaseProjectileFire;

var() sound StereoFireSound;

function Projectile SpawnProjectile(vector Start, rotator Dir)
{
	local pgPortalProjectile Proj;
	local pgPortalKillVolume V;

	foreach Instigator.TouchingActors(Class'pgPortalKillVolume',V)
		return None; // May not fire a portal while inside one of these!
	Proj = pgPortalProjectile(Super.SpawnProjectile(Start, Dir));
	if (Proj == none)
		return None;
	Proj.WeaponOwner = pgPortalGun(Weapon);
	Proj.FireMode = ThisModeNum;

	return Proj;
}
function PlayFiring()
{
	if ( Weapon.Mesh != None )
	{
		if ( FireCount > 0 )
		{
			if ( Weapon.HasAnim(FireLoopAnim) )
				Weapon.PlayAnim(FireLoopAnim, FireLoopAnimRate, 0.0);
			else Weapon.PlayAnim(FireAnim, FireAnimRate, TweenTime);
		}
		else Weapon.PlayAnim(FireAnim, FireAnimRate, TweenTime);
	}

	if( StereoFireSound!=none && Weapon.Instigator != none && Weapon.Instigator.IsLocallyControlled() && Weapon.Instigator.IsFirstPerson() )
		Weapon.PlayOwnedSound(StereoFireSound,SLOT_Interact,TransientSoundVolume,,TransientSoundRadius,Default.FireAnimRate/FireAnimRate,false);
    else Weapon.PlayOwnedSound(FireSound,SLOT_Interact,TransientSoundVolume,,TransientSoundRadius,Default.FireAnimRate/FireAnimRate,false);
    ClientPlayForceFeedback(FireForce);  // jdf

    FireCount++;
}

defaultproperties
{
     ProjSpawnOffset=(X=25.000000,Y=12.000000,Z=-8.000000)
     bFireOnRelease=False
	bWaitForRelease=true
     FireAnimRate=0.750000
     FireSound=Sound'pg_shoot_blue1'
	StereoFireSound=Sound'pg_shoot_blue1_s'
     FireRate=0.800000
     AmmoClass=Class'pgDudAmmo'
     ProjectileClass=Class'pgPortalProjectile'
	TransientSoundVolume=2
	TransientSoundRadius=450
}